package logger

import (
	"github.com/natefinch/lumberjack"
	"go.uber.org/zap"
)

// Config logger config
// use lumberjack writing logs to rolling files.
// Level as AtomicLevel is an atomically changeable, dynamic logging level.
//
type Config struct {
	*lumberjack.Logger
	Level       zap.AtomicLevel `json:"level" yaml:"level"`
	Development bool            `json:"development" yaml:"development"`
}

var (
	DevelopmentConfig = &Config{
		Logger:      nil,
		Level:       zap.NewAtomicLevelAt(zap.DebugLevel),
		Development: true,
	}

	ProductionConfig = &Config{
		Logger:      nil,
		Level:       zap.NewAtomicLevel(),
		Development: false,
	}
)
